package e.odbo.data.generate.model.jumpmind;

import e.odbo.data.generate.model.I_ModelManager;
import org.jumpmind.db.io.DatabaseXmlUtil;
import org.jumpmind.db.model.Database;

import java.io.InputStream;
import java.io.OutputStream;

public class JumpmindManager implements I_ModelManager {

    public static String NAME = "jumpmindModel";

    @Override
    public String name() {
        return NAME;
    }

    @Override
    public String getSupportFilePostfix() {
        return ".xml";
    }

    @Override
    public Database readDatabase(InputStream inputStream) {
        return DatabaseXmlUtil.read(inputStream);
    }

    @Override
    public void writeDatabase(Database database, OutputStream out) {
        DatabaseXmlUtil.write(database, out);
    }


}
